_YHC_UTIL ={
    queryProxyBizData  : function(serviceName,headerInfo,bizInfo, successCallBackFn, failCallBackFn) {
        $.ajax({
            url:'/biz.ajax',
            method:'GET',
            cache:false,
            headers: {
                "Accept" : "text/plain; charset=utf-8",
                "Content-Type": "text/plain; charset=utf-8"
            },
            data:{
                'serviceName': serviceName,
                'headerInfo': JSON.stringify(headerInfo),
                'bizInfo': JSON.stringify(bizInfo)
            },
            success:function(data,textStatus,jqXHR){
                // console.log("成功=",data)
                successCallBackFn(JSON.parse(data))
            },
            error:function(xhr,textStatus){
                // console.log('失败=',xhr)
                failCallBackFn(xhr)
            }
        })
    },
    scrollTop:function(){
        var scrollTops = document.documentElement.scrollTop || document.body.scrollTop;
        if (scrollTops >= 10) {
            $("header.bs-docs-nav").css("background-color", "#222");
        } else {
            $("header.bs-docs-nav").css("background-color", "transparent");
        }
    }
}

//监听屏幕滚动事件
window.onscroll = function () {
    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
    if (scrollTop >= 10) {
        $("header.bs-docs-nav").css("background-color", "#222");
    } else {
        $("header.bs-docs-nav").css("background-color", "transparent");
    }
}
// 线条伸缩动画
var lineLong = function(num) {
    // console.log(num)
    toLong(".line_"+num+"");
}
var lineShort = function(num) {
    toShort(".line_"+num+"")
}
function toLong(obj) {
    $(obj).addClass('long')
    $(obj).removeClass('short')
}
function toShort(obj) {
    $(obj).addClass('short')
    $(obj).removeClass('long')
}

//监听动画效果
if (/\bMSIE [6789]\.0\b/.test(navigator.userAgent)) {

} else {
    var byup1 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 200,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byup2 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 250,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byup3 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 300,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byup4 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 350,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byup5 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 400,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byup6 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 450,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byupDelay1 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 0,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byupDelay2 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 300,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byupDelay3 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 600,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    var byupDelay4 = {
        origin: "bottom",
        distance: "100px",
        duration: 800,
        delay: 900,
        scale: 1,
        easing: 'cubic-bezier(.215,.61,.355,1)',
        opacity: 0
    }
    window.sr = new ScrollReveal();
    sr.reveal(".byup1", byup1);
    sr.reveal(".byup2", byup2);
    sr.reveal(".byup3", byup3);
    sr.reveal(".byup4", byup4);
    sr.reveal(".byup5", byup5);
    sr.reveal(".byup6", byup6);
    sr.reveal(".byupDelay1", byupDelay1);
    sr.reveal(".byupDelay2", byupDelay2);
    sr.reveal(".byupDelay3", byupDelay3);
    sr.reveal(".byupDelay4", byupDelay4);
}

//过滤案件类型
function filterCaseTypeId(input) {
    var caseType = "";
    if(input != "" && input != null){
        var caseTypeList = JSON.parse(localStorage.getItem("caseTypeListCache"));
        for(var i=0;i<caseTypeList.length;i++){
            if(caseTypeList[i].caseTypeId == input){
                caseType = caseTypeList[i].caseTypeName;
                break;
            }
        }
    }
    return caseType;
}
//过滤金额
function filterAmount(input) {
    var unit = "";
    if(input != "" && input != null){
        var amt = _YHC_util.formatMoney(_YHC_util.math.accDiv(input *1,10000),2);
        if(amt == 0){
            amt = _YHC_util.formatMoney(_YHC_util.math.accDiv(input *1,10000),2);
        }
        unit = amt;
    }
    return unit;
}
//过滤案件状态
function investStatusFilter(input) {
    //案件状态
    // 1未提交；2已提交；3业务审核通过；4风控审核通过；5已承接；0已关闭；A审核拒绝B待委托；C已委托;D风控审核中；
    var name = "";
    if(input != "" && input != null){
        name = (input === "1")?"未提交":(input === "2")?"已提交":(input === "3")?"待安排风控":(input === "4")?"风控审核通过":(input === "5")?"已承接":(input === "8")?"异常结案":(input === "9")?"已结案":(input === "0")?"已关闭":(input === "A")?"审核拒绝":(input === "B")?"待委托":(input === "C")?"已委托":(input === "D")?"风控审核中":(input === "F")?"合同已确认":(input === "G")?"合同已签约":(input === "H")?"诊断完成":"其它";
    }
    return name;
}

//过滤13位时间戳
function timetransStr(date){
    if(!date){
        return ''
    }
    var _date = new Date(date);//如果date为13位不需要乘1000
    var Y = _date.getFullYear();
    var M = _date.getMonth()+1 < 10 ? '0'+(_date.getMonth()+1) : _date.getMonth()+1;
    var D = _date.getDate() < 10 ? '0' + (_date.getDate()) : _date.getDate();
    var h = _date.getHours() < 10 ? '0' + _date.getHours() : _date.getHours();
    var m = _date.getMinutes() <10 ? '0' + _date.getMinutes() : _date.getMinutes();
    var s = _date.getSeconds() <10 ? '0' + _date.getSeconds() : _date.getSeconds();
    return {
        date:Y+'-'+M+'-'+D,
        time:h+':'+m+':'+s
    }
}
//过滤财产线索
function filterPropertyClue(input) {
    //财产线索
    var name = "";
    if(input != "" && input != null){
        name = (input === "Y")?"是":"否";
    }
    return name;
}
//过滤案件阶段
function filterCaseStageId(input) {
    //案件阶段
    var caseStage = "";
    if(input != "" && input != null){
        var caseTypeList = JSON.parse(localStorage.getItem("caseStageListCache"));
        for(var i=0;i<caseTypeList.length;i++){
            if(caseTypeList[i].caseStageId == input){
                caseStage = caseTypeList[i].caseStageName;
                break;
            }
        }
    }
    return caseStage;
}
// //过滤日期
function formatDateStr(input) {
    var returnDate = "";
    if(input != "" && input != null && input != 'null'){
        returnDate = input.substring(0,4) + "-" + input.substring(4,6) + "-" + input.substring(6,8);

    }
    return returnDate;
}
